<?php 
    class pagination extends CI_Controller{
         
        function __construct(){ 
            parent::__construct(); 
            $this->load->model('Pagination_Model');

        } 
         
        function index(){
        $data['path']="pagination/index";
        $data['title']="List Products";
		$this->load->library('pagination');
		$this->load->helper('url');
		$this->load->library('table');
		$config['base_url'] = base_url('admin/pagination');
		$config['total_rows'] = $this->Pagination_Model->count_all();
		$config['per_page'] = 4;
		$config['uri_segment'] = 3;
		$this->pagination->initialize($config);
		$data['list_all'] = $this->Pagination_Model->list_all($config['per_page'],$this->uri->segment(3));
        $this->load->view('index',$data);
        }
        public function  StrPro()
        {
            $data['path']="pagination/index";
            $this->load->library('pagination');
            $this->load->helper('url');
            $this->load->library('table');
            $this->load->model('SearchPro');
            $config['base_url'] = base_url('default.php/pagination');
            $config['total_rows'] = $this->Pagination_Model->count_all();
            $config['per_page'] = 5;
            $config['uri_segment'] = 2;
            $this->pagination->initialize($config);
            $keyword=$this->uri->segment(4);
            $data['list_all'] = $this->SearchPro->search($keyword);
            $this->load->view('index',$data);

        }
    } 
?> 